﻿using System.Collections.Generic;

namespace Haimen;

internal class WorkshopMainRunner(
    EntryArgParser argParser,
    FuncDictMaker funcDictMaker) {

  public void Run(string[] args) {
    EntryArgResult entryArgs = _argParser.Parse(args);
    string func = entryArgs.Func;

    Dictionary<string, WorkshopFuncMain> funcDict = _funcDictMaker.Make(func);
    //foreach (var kkk in funcDict.Keys) {
    //  Console.WriteLine(kkk);
    //}
    //return;

    funcDict[func].Run(entryArgs);
  }

  readonly EntryArgParser _argParser = argParser;
  readonly FuncDictMaker _funcDictMaker = funcDictMaker;
}
